<include file="header" />
<div class="head clearfix">
	<a href="{BEESCRM::U('/meeting/meeting/ucenter',array('account_id' => $accountId))}" class="iconfont icon-zuo"></a>
	<span class="head-name">我的会议</span>
	<input type="hidden" value="{BEESCRM:$accountId}" id="js_account_id"/>
</div>
<div class="wraper">
	<div class="tab clearfix">
		<?php if(isset($role['is_organizer']) && $role['is_organizer'] != 1){?>
			<a href="/Meeting/MeetingPersonal/index/type/1/account_id/{BEESCRM:$accountId}" class="tab-list <?php if($type == 1) echo 'visited';?>">已确认</a>
			<a href="/Meeting/MeetingPersonal/index/type/2/account_id/{BEESCRM:$accountId}" class="tab-list <?php if($type == 2) echo 'visited';?>">已报名</a>
		<?php }else{?>
			<a href="/Meeting/MeetingPersonal/index/type/1/account_id/{BEESCRM:$accountId}" class="tab-list <?php if($type == 1) echo 'visited';?>" style="width: 33.3%;">已确认</a>
			<a href="/Meeting/MeetingPersonal/index/type/2/account_id/{BEESCRM:$accountId}" class="tab-list <?php if($type == 2) echo 'visited';?>" style="width: 33.3%;">已报名</a>
			<a href="/Meeting/MeetingPersonal/index/type/3/account_id/{BEESCRM:$accountId}" class="tab-list <?php if($type == 3) echo 'visited';?>" style="width: 33.3%;">我发布的</a>
		<?php }?>

	</div>
	<if condition="empty($myMeetingList)">
		<!--无记录-->
		<div class="norecord">
			<img src="/assets/meeting/images/nomeeting.png"/>
			<if condition="$type eq 1">
				<p class="text-gray">暂无已确认会议</p>
				<elseif condition="$type eq 2" />
				<p class="text-gray">暂无已报名会议</p>
				<else/>
				<p class="text-gray">暂未发布会议</p>
			</if>

		</div>
	<else/>
		<volist name="myMeetingList" id="item">
			<if condition="$type eq 3">
			<a data-status="{BEESCRM:$item.status}" data-draft_url="/Meeting/MeetingInvite/editDraft/account_id/{BEESCRM:$accountId}/basic_id/{BEESCRM:$item.basic_id}" href="<if condition='$item.status eq 10'>javascript:;<else/>/Meeting/MeetingPersonal/meetingDetail?basic_id={BEESCRM:$item.basic_id}&type=3&account_id={BEESCRM:$accountId}&check=1</if>" class="lists tb-mode js_draft">
				<div class="room-img tb-cell">
					<if condition="$item.publicity_pic eq ''">
						<img src="/assets/meeting/images/meetingdefault.png"/>
					<else/>
						<img src="{BEESCRM:$item.publicity_pic}"/>
					</if>

					<if condition="$item.is_confirm eq 1">
						<span class="tips status bg-green">已确认</span>
					</if>					
				</div>
				<div class="text-block tb-cell">
					<p class="title">{BEESCRM:$item.title}
						<if condition="$type eq 3">
							<switch name="item.status">
								<case value="1">
									<if condition="$item.status eq 1 and $item.multilevel eq 0">(已申请)</if>
									<if condition="$item.status eq 1 and $item.multilevel eq 1 and $item.multilevel_pass eq 0" >(已初审)</if>
								</case>

								<case value="2">(审核通过)</case>
								<case value="3">(审核不通过)</case><case value="4">(已取消)</case>
								<case value="5">(已上传)</case><case value="10">(草稿)</case>
							</switch>
						</if>
					</p>
					<p><if condition="strlen($item.content) egt 32">{BEESCRM:$item.content|msubstr=###,0,12,'utf-8',true}<else/>{BEESCRM:$item.content}</if></p>
					<p class="text-gray"><span class="iconfont icon-shijian"></span><if condition="($item.start_time neq '0') or ($item.end_time neq '0')">{BEESCRM:$item.start_time|date='Y-m-d  H:i',###}-{BEESCRM:$item.end_time|date='Y-m-d H:i',###}</if></p>
					<p class="text-gray">
						<span class="iconfont icon-ditu"></span>
						{BEESCRM:$item.meeting_room_info.address} {BEESCRM:$item.meeting_room_info.room_name}
					</p>
				</div>
			</a>
			<else/>
				<a data-status="{BEESCRM:$item.status}" data-draft_url="/Meeting/MeetingInvite/editDraft/account_id/{BEESCRM:$accountId}/basic_id/{BEESCRM:$item.basic_id}" href="<if condition='$item.status eq 10'>javascript:;<else/>/Meeting/MeetingPersonal/meetingDetail?basic_id={BEESCRM:$item.basic_id}&account_id={BEESCRM:$accountId}</if>" class="lists tb-mode js_draft">
					<div class="room-img tb-cell">
						<if condition="$item.publicity_pic eq ''">
							<img src="/assets/meeting/images/meetingdefault.png"/>
							<else/>
							<img src="{BEESCRM:$item.publicity_pic}"/>
						</if>

						<if condition="$item.is_confirm eq 1">
							<span class="tips status bg-green">已确认</span>
						</if>
					</div>
					<div class="text-block tb-cell">
						<p class="title">{BEESCRM:$item.title}
							<if condition="$type eq 3">
								<switch name="item.status">
									<case value="1">(已申请)</case><case value="2">(审核通过)</case>
									<case value="3">(审核不通过)</case><case value="4">(已取消)</case>
									<case value="5">(已上传)</case><case value="10">(草稿)</case>
								</switch>
							</if>
						</p>
						<p>{BEESCRM:$item.content|strip_tags|msubstr=###,0,12,'utf-8',true}</p>
						<p class="text-gray"><span class="iconfont icon-shijian"></span><if condition="($item.start_time neq '0') or ($item.end_time neq '0')">{BEESCRM:$item.start_time|date='Y-m-d  H:i',###}-{BEESCRM:$item.end_time|date='Y-m-d H:i',###}</if></p>
						<p class="text-gray">
							<span class="iconfont icon-ditu"></span>
							{BEESCRM:$item.meeting_room_info.address} {BEESCRM:$item.meeting_room_info.room_name}
						</p>
					</div>
				</a>
			</if>
		</volist>
	</if>

</div>
<include file="footer" />
<script type="text/javascript" src="/assets/public/seajs/sea.js"></script>
<script enter="publicjs/public" id="confnode" async="async" src="/assets/public/config.js"></script>
<script type="text/javascript" src="/assets/public/jquery-2.1.0.min.js"></script>
<script type="text/javascript">
	$('.js_draft').on('click',function () {
		var status = $(this).attr('data-status');
		var draftUrl = $(this).attr('data-draft_url');
		var accountId = $('#js_account_id').val();
		if(status == 10){
			$.ajax({
				url : draftUrl,
				type : 'GET',
				success : function (data) {
					if(typeof (data) == 'string'){
						data = JSON.parse(data);
					}
					if(data.status == 'S'){
						location.href = '/Meeting/MeetingInvite/addInviteMeeting/draft/1/account_id/' + accountId ;
						return;
					}
					if(data.status == 'F'){
						fm.alert(data.message);
						return;
					}
				}
			})
		}
	})
</script>